package com.area.mapper;

import com.area.entity.Area;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * BASIC_地区 Mapper 接口
 * </p>
 *
 * @author guanfenga@yonyou.com
 * @since 2022-08-17
 */
// @Mapper
@Mapper
public interface AreaMapper extends BaseMapper<Area> {

    String columns = "`areaId`, `fullName`, `name`, `treePath`, `areaCode`, `parentId`, " +
            "`orders`, `isLeaf`, `createDate`, `modifyDate`, `districtnumber`, `isactive` ";


    @Select("SELECT "+columns+" FROM mall_area LIMIT #{been} , #{after}")
    List<Map<String,Object>> findAreaPage(@Param("been") Integer pageBefore, @Param("after") Integer limit);

    @Select("SELECT "+columns+" FROM mall_area where  LIMIT #{been} , #{after}")
    List<Area> findAreaPage(@Param("been") Integer page,@Param("after") Integer limit, Area area);

    /**
     * 查询所有区块信息
     * @return
     */
    @Select("select "+columns+" from mall_area ")
    List<Area> queryBasicAreaAll();
}
